#include "widget.h"
#include "ui_widget.h"
#include<QPushButton>
#include<QGridLayout>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{

    ui->setupUi(this);
    QPushButton* btn1=new QPushButton("按钮1");
    QPushButton* btn2=new QPushButton("按钮2");
    QPushButton* btn3=new QPushButton("按钮3");
    QPushButton* btn4=new QPushButton("按钮4");

    QGridLayout* layout=new QGridLayout();

    layout->addWidget(btn1,0,0);
    layout->addWidget(btn2,0,1);
    layout->addWidget(btn3,1,0);
    layout->addWidget(btn4,1,1);

    this->setLayout(layout);


}

Widget::~Widget()
{
    delete ui;
}

